Skip to content

Method: static {...}

1: package cz.cvut.kbss.jsonld.deserialization.datetime;
2:
3: import cz.cvut.kbss.jopa.datatype.DateTimeUtil;
4: import cz.cvut.kbss.jsonld.common.Configurable;
5:
6: import java.time.Instant;
7: import java.time.OffsetDateTime;
8:
9: /**
10: * Resolves date time from the specified number of milliseconds since the Unix Epoch.
11: */
12: class EpochBasedDateTimeResolver implements Configurable {
13:
14: OffsetDateTime resolve(Long value) {
15: assert value != null;
16: return DateTimeUtil.toDateTime(Instant.ofEpochMilli(value));
17: }
18: }